﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/MasterFinance.master" AutoEventWireup="true" CodeFile="InsertProductsRepository.aspx.cs" Inherits="FinanceUsers_InsertProductsRepository" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Header1" Runat="Server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div style="background-color:#FFCC66;direction:rtl;padding-bottom:20px;padding-top:10px;border:1px solid #ccc;box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.075) inset;border-radius: 4px;font-family:Tahoma">
        <div style="padding-right:350px; width:100%">
        <asp:Image ID="Image2" runat="server" 
                        ImageUrl="~/Images/Device1.png" Width="17%"  />
        </div>
        <div style=" background-color:#FFCC99;width:80%;margin:auto;border:1px solid #FF9966; box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.075) inset;border-radius: 4px;">

<table style="width: 100%;direction:rtl" >
    <tr>
      <td align="center" style="height: 27px;" bgcolor="#FF9900" colspan="4" >
                <asp:Label ID="Label12" runat="server" Font-Size="14px" ForeColor="#CC3300" 
                    Text="درج و ویرایش کالاهای انبار"></asp:Label>
                    
            </td>
    </tr>
    <tr>
    <td></td>
    </tr>
        <tr align="right" >
         
            <td>
                &nbsp;
             
              
            </td>
         
            <td style="width:7%;">
             <asp:Label ID="Label1" runat="server" Text="نام کالا"></asp:Label>
            </td>
            <td align="right" > &nbsp;
                  <asp:DropDownList ID="drDevice" runat="server" DataSourceID="SqlDevice" 
                    DataTextField="Name" DataValueField="Id" Width="142px" CssClass="textbox">
                </asp:DropDownList>
               
            </td>
            <td >
                 <asp:SqlDataSource ID="SqlDevice" runat="server" 
            ConnectionString="<%$ ConnectionStrings:CON %>" 
            ProviderName="System.Data.SqlClient" 
            SelectCommand="SELECT [Name], [Id] FROM [TblDevice]">
        </asp:SqlDataSource>
               
            </td>
        </tr>
        <tr align="right">
            <td>
                &nbsp;
            </td>
            <td>
                <asp:Label ID="Label2" runat="server" Text="تاریخ"></asp:Label>
            </td>
            <td>
                &nbsp;
                <asp:TextBox ID="txtTime" runat="server" CssClass="textbox"></asp:TextBox>
            </td>
            <td>
                &nbsp;
                </td>
        </tr>
        <tr align="right">
            <td>
                &nbsp;
            </td>
            <td>
                <asp:Label ID="Label3" runat="server" Text="تعداد"></asp:Label>
            </td>
            <td>
                &nbsp;
                <asp:TextBox ID="txtCount" runat="server" CssClass="textbox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtCount" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
            </td>
            <td>
                &nbsp;
                </td>
        </tr>
        <tr align="right">
            <td>
                &nbsp;</td>
            <td>
                <asp:Label ID="Label4" runat="server" Text="سریال کالا"></asp:Label>
            </td>
            <td>
                <br />
            <asp:Label ID="lblMesg" runat="server" style = "color:#FFFF9" Text = "فایل اکسل حاوی شماره سریال را انتخاب کنید." />

           
                

              
                
                <br />
                <asp:FileUpload ID="FileUploadExcel" runat="server"  />
              
              <br />
              <asp:Label ID="lblMsgFile" runat="server" ForeColor="Red"></asp:Label>


                <br />
                <br />

            </td>
            <td>
            </td>
        </tr>
        <tr align="right">
            <td>
                &nbsp;</td>
            <td>
               
             
            </td>
            <td>
               <asp:Button ID="btnInsert" runat="server" onclick="btnInsert_Click" 
                    Text="ثبت " Width="83px" CssClass="Button" BackColor="#FF9900" />
             <asp:Button ID="btnCancle" runat="server" Text="انصراف" 
                    onclick="btnCancle_Click" Width="83px" CssClass="Button" BackColor="#FF9900" />
                <asp:Label ID="lblMessage" runat="server"></asp:Label>

            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr align="right">
        <td>
                &nbsp;</td>
        <td>
                &nbsp;</td>
            <td align="right">
                &nbsp;</td>
            <td>
               
                &nbsp;</td>
           
        </tr>
        <tr>
            <td colspan="4">
               <div style="border: 1px solid #DEDEDE;border-radius:3px;box-shadow: 0px 0px 10px rgba(189, 189, 189, 0.4);padding :10px;width:70%;margin:auto;background-color:rgba(0, 0, 0, 0.067)">
                <div  class="headerTable" >
                <div style="width:10%;float:right">
                    <asp:Image ID="Image1" runat="server" src="../Images/Device2.png" Height="40px" />
                </div>
                <div style="width:50%;float:right">
                    <h3><asp:Label ID="Label10" runat="server" Text="اطلاعات کالاهای ثبت شده" 
                            ForeColor="#CC3300"></asp:Label></h3>
                </div>
                
                
                </div>
                <div  >
                <asp:GridView ID="GrwDeviceRpos" runat="server" AutoGenerateColumns="False" 
                    CellPadding="3" DataSourceID="SqlDataSourceDevice" 
                    Width="100%" AllowPaging="True" AllowSorting="True" BackColor="White" 
                    BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
                      onrowcommand="GrwDeviceRpos_RowCommand" DataKeyNames="Id"  >
                    <Columns>
                  
                    <asp:BoundField DataField="Name" HeaderText="نام کالا"  SortExpression="Name"  ReadOnly="true"/>
                    <asp:BoundField DataField="Count" HeaderText=" تعداد"  SortExpression="Count" ReadOnly="true" />
                    <asp:BoundField DataField="date" HeaderText=" تاریخ"  SortExpression="date" ReadOnly="true"/>
                    
                    
                     
                    
                        <asp:TemplateField>
                        <ItemTemplate>
                        <%--<asp:LinkButton ID="LinkButton1" CommandName="Edit" CausesValidation="false" CommandArgument='<%#Eval("Id")%>' Text="ویرایش" runat="server"></asp:LinkButton>--%>
                            <asp:ImageButton ID="ImageButton1" runat="server" CommandName="Edit" CausesValidation="false" CommandArgument='<%#Eval("Id")%>' Text="ویرایش" ImageUrl="../ImageIcon/Edit-icon.png"   AlternateText="ویرایش" />
                        </ItemTemplate>
                        </asp:TemplateField>
                     
                    </Columns>
                    
                    <FooterStyle BackColor="White" ForeColor="#000066" />
                    <HeaderStyle BackColor="#FF9900" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                    <RowStyle ForeColor="#000066"  />
                   
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#007DBB" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#00547E" />
                </asp:GridView>
                </div>
                </div>
                </td>
        </tr>
    </table>
    </div>
        <asp:SqlDataSource ID="SqlDataSourceDevice" runat="server" ConnectionString="<%$ ConnectionStrings:CON %>"
        ProviderName="System.Data.SqlClient" 
       SelectCommand="SELECT TblRepository.Id,TblDevice.Name,TblRepository.date,TblRepository.Count FROM TblRepository JOIN TblDevice ON TblDevice.ID=TblRepository.DeviceId "
        ></asp:SqlDataSource>

            </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Header" Runat="Server">

    

</asp:Content>

